package com.kongwg.java;

import org.junit.Test;

import java.util.Scanner;

/**
 * @author kongwg
 * @create 2020-12-29 20:14
 */
public class IfTest {

    @Test
    public void test() {
//       要求用户输入两个数a和b，如果a能被b整除或者a加b大于1000，则输出a；否则输出b。
        Scanner scanner = new Scanner(System.in);

        System.out.println("输入a:" );
        int a = scanner.nextInt();
        System.out.println("输入b:" );
        int b = scanner.nextInt();

        if (a % b ==0 || a + b == 1000){
            System.out.println(a);
        }else{
            System.out.println(b);
        }


    }


}
